Integrand size = 17, antiderivative size = 57 \[ \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx=\frac {2 b \cos (c+d x)}{d^3}-\frac {b x^2 \cos (c+d x)}{d}+a \operatorname {CosIntegral}(d x) \sin (c)+\frac {2 b x \sin (c+d x)}{d^2}+a \cos (c) \text {Si}(d x) \]
2*b*cos(d*x+c)/d^3-b*x^2*cos(d*x+c)/d+a*cos(c)*Si(d*x)+a*Ci(d*x)*sin(c)+2* b*x*sin(d*x+c)/d^2
Time = 0.12 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.88 \[ \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx=a \operatorname {CosIntegral}(d x) \sin (c)+\frac {b \left (\left (2-d^2 x^2\right ) \cos (c+d x)+2 d x \sin (c+d x)\right )}{d^3}+a \cos (c) \text {Si}(d x) \]
a*CosIntegral[d*x]*Sin[c] + (b*((2 - d^2*x^2)*Cos[c + d*x] + 2*d*x*Sin[c + d*x]))/d^3 + a*Cos[c]*SinIntegral[d*x]
Time = 0.28 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3820, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx\) |
\(\Big \downarrow \) 3820 |
\(\displaystyle \int \left (\frac {a \sin (c+d x)}{x}+b x^2 \sin (c+d x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle a \sin (c) \operatorname {CosIntegral}(d x)+a \cos (c) \text {Si}(d x)+\frac {2 b \cos (c+d x)}{d^3}+\frac {2 b x \sin (c+d x)}{d^2}-\frac {b x^2 \cos (c+d x)}{d}\) |
(2*b*Cos[c + d*x])/d^3 - (b*x^2*Cos[c + d*x])/d + a*CosIntegral[d*x]*Sin[c ] + (2*b*x*Sin[c + d*x])/d^2 + a*Cos[c]*SinIntegral[d*x]
3.1.83.3.1 Defintions of rubi rules used
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*Sin[(c_.) + (d_.)*(x_ )], x_Symbol] :> Int[ExpandIntegrand[Sin[c + d*x], (e*x)^m*(a + b*x^n)^p, x ], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.18 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.72
method | result | size |
risch | \(-\frac {{\mathrm e}^{-i c} \pi \,\operatorname {csgn}\left (d x \right ) a}{2}-\frac {i {\mathrm e}^{-i c} \operatorname {Ei}_{1}\left (-i d x \right ) a}{2}+\frac {i a \,{\mathrm e}^{i c} \operatorname {Ei}_{1}\left (-i d x \right )}{2}-\frac {b \,x^{2} \cos \left (d x +c \right )}{d}+{\mathrm e}^{-i c} \operatorname {Si}\left (d x \right ) a +\frac {2 b x \sin \left (d x +c \right )}{d^{2}}+\frac {2 b \cos \left (d x +c \right )}{d^{3}}\) | \(98\) |
derivativedivides | \(a \left (\operatorname {Si}\left (d x \right ) \cos \left (c \right )+\operatorname {Ci}\left (d x \right ) \sin \left (c \right )\right )-\frac {3 b \,c^{2} \cos \left (d x +c \right )}{d^{3}}-\frac {3 b c \left (c +1\right ) \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{3}}+\frac {\left (c^{2}+c +1\right ) b \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{3}}\) | \(112\) |
default | \(a \left (\operatorname {Si}\left (d x \right ) \cos \left (c \right )+\operatorname {Ci}\left (d x \right ) \sin \left (c \right )\right )-\frac {3 b \,c^{2} \cos \left (d x +c \right )}{d^{3}}-\frac {3 b c \left (c +1\right ) \left (\sin \left (d x +c \right )-\cos \left (d x +c \right ) \left (d x +c \right )\right )}{d^{3}}+\frac {\left (c^{2}+c +1\right ) b \left (-\left (d x +c \right )^{2} \cos \left (d x +c \right )+2 \cos \left (d x +c \right )+2 \left (d x +c \right ) \sin \left (d x +c \right )\right )}{d^{3}}\) | \(112\) |
meijerg | \(\frac {4 b \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {x \left (d^{2}\right )^{\frac {3}{2}} \cos \left (d x \right )}{2 \sqrt {\pi }\, d^{2}}-\frac {\left (d^{2}\right )^{\frac {3}{2}} \left (-\frac {3 d^{2} x^{2}}{2}+3\right ) \sin \left (d x \right )}{6 \sqrt {\pi }\, d^{3}}\right )}{d^{2} \sqrt {d^{2}}}+\frac {4 b \sqrt {\pi }\, \cos \left (c \right ) \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\left (-\frac {d^{2} x^{2}}{2}+1\right ) \cos \left (d x \right )}{2 \sqrt {\pi }}+\frac {d x \sin \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{3}}+\frac {a \sqrt {\pi }\, \sin \left (c \right ) \left (\frac {2 \gamma +2 \ln \left (x \right )+\ln \left (d^{2}\right )}{\sqrt {\pi }}-\frac {2 \gamma }{\sqrt {\pi }}-\frac {2 \ln \left (2\right )}{\sqrt {\pi }}-\frac {2 \ln \left (\frac {d x}{2}\right )}{\sqrt {\pi }}+\frac {2 \,\operatorname {Ci}\left (d x \right )}{\sqrt {\pi }}\right )}{2}+a \cos \left (c \right ) \operatorname {Si}\left (d x \right )\) | \(176\) |
-1/2*exp(-I*c)*Pi*csgn(d*x)*a-1/2*I*exp(-I*c)*Ei(1,-I*d*x)*a+1/2*I*a*exp(I *c)*Ei(1,-I*d*x)-b*x^2*cos(d*x+c)/d+exp(-I*c)*Si(d*x)*a+2*b*x*sin(d*x+c)/d ^2+2*b*cos(d*x+c)/d^3
Time = 0.28 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.02 \[ \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx=\frac {a d^{3} \operatorname {Ci}\left (d x\right ) \sin \left (c\right ) + a d^{3} \cos \left (c\right ) \operatorname {Si}\left (d x\right ) + 2 \, b d x \sin \left (d x + c\right ) - {\left (b d^{2} x^{2} - 2 \, b\right )} \cos \left (d x + c\right )}{d^{3}} \]
(a*d^3*cos_integral(d*x)*sin(c) + a*d^3*cos(c)*sin_integral(d*x) + 2*b*d*x *sin(d*x + c) - (b*d^2*x^2 - 2*b)*cos(d*x + c))/d^3
Time = 2.75 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.46 \[ \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx=a \sin {\left (c \right )} \operatorname {Ci}{\left (d x \right )} + a \cos {\left (c \right )} \operatorname {Si}{\left (d x \right )} + b x^{2} \left (\begin {cases} x \sin {\left (c \right )} & \text {for}\: d = 0 \\- \frac {\cos {\left (c + d x \right )}}{d} & \text {otherwise} \end {cases}\right ) - 2 b \left (\begin {cases} \frac {x^{3} \sin {\left (c \right )}}{3} & \text {for}\: d = 0 \\- \frac {\begin {cases} \frac {x \sin {\left (c + d x \right )}}{d} + \frac {\cos {\left (c + d x \right )}}{d^{2}} & \text {for}\: d \neq 0 \\\frac {x^{2} \cos {\left (c \right )}}{2} & \text {otherwise} \end {cases}}{d} & \text {otherwise} \end {cases}\right ) \]
a*sin(c)*Ci(d*x) + a*cos(c)*Si(d*x) + b*x**2*Piecewise((x*sin(c), Eq(d, 0) ), (-cos(c + d*x)/d, True)) - 2*b*Piecewise((x**3*sin(c)/3, Eq(d, 0)), (-P iecewise((x*sin(c + d*x)/d + cos(c + d*x)/d**2, Ne(d, 0)), (x**2*cos(c)/2, True))/d, True))
Result contains complex when optimal does not.
Time = 0.58 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.33 \[ \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx=\frac {{\left (a {\left (-i \, {\rm Ei}\left (i \, d x\right ) + i \, {\rm Ei}\left (-i \, d x\right )\right )} \cos \left (c\right ) + a {\left ({\rm Ei}\left (i \, d x\right ) + {\rm Ei}\left (-i \, d x\right )\right )} \sin \left (c\right )\right )} d^{3} + 4 \, b d x \sin \left (d x + c\right ) - 2 \, {\left (b d^{2} x^{2} - 2 \, b\right )} \cos \left (d x + c\right )}{2 \, d^{3}} \]
1/2*((a*(-I*Ei(I*d*x) + I*Ei(-I*d*x))*cos(c) + a*(Ei(I*d*x) + Ei(-I*d*x))* sin(c))*d^3 + 4*b*d*x*sin(d*x + c) - 2*(b*d^2*x^2 - 2*b)*cos(d*x + c))/d^3
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.32 (sec) , antiderivative size = 510, normalized size of antiderivative = 8.95 \[ \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx=-\frac {2 \, b d^{2} x^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + a d^{3} \Im \left ( \operatorname {Ci}\left (d x\right ) \right ) \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - a d^{3} \Im \left ( \operatorname {Ci}\left (-d x\right ) \right ) \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, a d^{3} \operatorname {Si}\left (d x\right ) \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - 2 \, a d^{3} \Re \left ( \operatorname {Ci}\left (d x\right ) \right ) \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - 2 \, a d^{3} \Re \left ( \operatorname {Ci}\left (-d x\right ) \right ) \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - 2 \, b d^{2} x^{2} \tan \left (\frac {1}{2} \, d x\right )^{2} - a d^{3} \Im \left ( \operatorname {Ci}\left (d x\right ) \right ) \tan \left (\frac {1}{2} \, d x\right )^{2} + a d^{3} \Im \left ( \operatorname {Ci}\left (-d x\right ) \right ) \tan \left (\frac {1}{2} \, d x\right )^{2} - 2 \, a d^{3} \operatorname {Si}\left (d x\right ) \tan \left (\frac {1}{2} \, d x\right )^{2} - 8 \, b d^{2} x^{2} \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right ) - 2 \, b d^{2} x^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + a d^{3} \Im \left ( \operatorname {Ci}\left (d x\right ) \right ) \tan \left (\frac {1}{2} \, c\right )^{2} - a d^{3} \Im \left ( \operatorname {Ci}\left (-d x\right ) \right ) \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, a d^{3} \operatorname {Si}\left (d x\right ) \tan \left (\frac {1}{2} \, c\right )^{2} - 2 \, a d^{3} \Re \left ( \operatorname {Ci}\left (d x\right ) \right ) \tan \left (\frac {1}{2} \, c\right ) - 2 \, a d^{3} \Re \left ( \operatorname {Ci}\left (-d x\right ) \right ) \tan \left (\frac {1}{2} \, c\right ) + 8 \, b d x \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right ) + 8 \, b d x \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, b d^{2} x^{2} - a d^{3} \Im \left ( \operatorname {Ci}\left (d x\right ) \right ) + a d^{3} \Im \left ( \operatorname {Ci}\left (-d x\right ) \right ) - 2 \, a d^{3} \operatorname {Si}\left (d x\right ) - 4 \, b \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - 8 \, b d x \tan \left (\frac {1}{2} \, d x\right ) - 8 \, b d x \tan \left (\frac {1}{2} \, c\right ) + 4 \, b \tan \left (\frac {1}{2} \, d x\right )^{2} + 16 \, b \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right ) + 4 \, b \tan \left (\frac {1}{2} \, c\right )^{2} - 4 \, b}{2 \, {\left (d^{3} \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + d^{3} \tan \left (\frac {1}{2} \, d x\right )^{2} + d^{3} \tan \left (\frac {1}{2} \, c\right )^{2} + d^{3}\right )}} \]
-1/2*(2*b*d^2*x^2*tan(1/2*d*x)^2*tan(1/2*c)^2 + a*d^3*imag_part(cos_integr al(d*x))*tan(1/2*d*x)^2*tan(1/2*c)^2 - a*d^3*imag_part(cos_integral(-d*x)) *tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*a*d^3*sin_integral(d*x)*tan(1/2*d*x)^2*ta n(1/2*c)^2 - 2*a*d^3*real_part(cos_integral(d*x))*tan(1/2*d*x)^2*tan(1/2*c ) - 2*a*d^3*real_part(cos_integral(-d*x))*tan(1/2*d*x)^2*tan(1/2*c) - 2*b* d^2*x^2*tan(1/2*d*x)^2 - a*d^3*imag_part(cos_integral(d*x))*tan(1/2*d*x)^2 + a*d^3*imag_part(cos_integral(-d*x))*tan(1/2*d*x)^2 - 2*a*d^3*sin_integr al(d*x)*tan(1/2*d*x)^2 - 8*b*d^2*x^2*tan(1/2*d*x)*tan(1/2*c) - 2*b*d^2*x^2 *tan(1/2*c)^2 + a*d^3*imag_part(cos_integral(d*x))*tan(1/2*c)^2 - a*d^3*im ag_part(cos_integral(-d*x))*tan(1/2*c)^2 + 2*a*d^3*sin_integral(d*x)*tan(1 /2*c)^2 - 2*a*d^3*real_part(cos_integral(d*x))*tan(1/2*c) - 2*a*d^3*real_p art(cos_integral(-d*x))*tan(1/2*c) + 8*b*d*x*tan(1/2*d*x)^2*tan(1/2*c) + 8 *b*d*x*tan(1/2*d*x)*tan(1/2*c)^2 + 2*b*d^2*x^2 - a*d^3*imag_part(cos_integ ral(d*x)) + a*d^3*imag_part(cos_integral(-d*x)) - 2*a*d^3*sin_integral(d*x ) - 4*b*tan(1/2*d*x)^2*tan(1/2*c)^2 - 8*b*d*x*tan(1/2*d*x) - 8*b*d*x*tan(1 /2*c) + 4*b*tan(1/2*d*x)^2 + 16*b*tan(1/2*d*x)*tan(1/2*c) + 4*b*tan(1/2*c) ^2 - 4*b)/(d^3*tan(1/2*d*x)^2*tan(1/2*c)^2 + d^3*tan(1/2*d*x)^2 + d^3*tan( 1/2*c)^2 + d^3)
Timed out. \[ \int \frac {\left (a+b x^3\right ) \sin (c+d x)}{x} \, dx=a\,\mathrm {cosint}\left (d\,x\right )\,\sin \left (c\right )+a\,\mathrm {sinint}\left (d\,x\right )\,\cos \left (c\right )+\frac {b\,\left (2\,\cos \left (c+d\,x\right )-d^2\,x^2\,\cos \left (c+d\,x\right )+2\,d\,x\,\sin \left (c+d\,x\right )\right )}{d^3} \]